package com.szxy.frontend.portal.feign;

import com.szxy.pojo.TbContent;
import com.szxy.pojo.TbContentCategory;
import com.szxy.utils.ContentAD;
import com.szxy.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther:zwer
 * @Date:2019/9/9 21:01
 * @Description:com.szxy.content.feign
 * @Version:1.0
 **/
@FeignClient("common-content")
public interface CommonContentFeignClient {

    //-----------------/service/contentCategory
    @GetMapping("/service/contentCategory/selectContentCategoryByParentId")
    List<TbContentCategory> selectContentCategoryByParentId(@RequestParam("id") Long id);

    @PostMapping("/service/contentCategory/updateContentCategoryById")
    Integer updateContentCategoryById(@RequestBody TbContentCategory tbContentCategory);

    @PostMapping("/service/contentCategory/insertContentCategory")
    int insertContentCategory(@RequestBody TbContentCategory contentCategory);

    @GetMapping("/service/contentCategory/deleteContentCategoryById")
    Integer deleteContentCategoryById(@RequestParam("categoryId") Long categoryId);

    //-----------------/service/content/
    @GetMapping("/service/content/selectTbContentAllByCategoryId")
    PageResult selectTbContentAllByCategoryId(@RequestParam("categoryId") Long categoryId,
                                              @RequestParam("page") Integer page,
                                              @RequestParam("rows") Integer rows);

    @PostMapping("/service/content/insertTbContent")
    int insertTbContent(@RequestBody TbContent content);

    @PostMapping("/service/content/deleteContentByIds")
    Integer deleteContentByIds(@RequestParam("ids") Long ids);

    @PostMapping("/service/content/selectFrontendContentByAD")
    List<ContentAD> selectFrontendContentByAD();
}
